namespace SimpleWebServices.Web.Mvc
{
    using System.Web.Mvc;
    using SimpleWebServices;
    using SimpleWebServices.Configuration;
    using Xunit;

    public sealed class InternalServerErrorViewResultFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<InternalServerErrorViewResult>()
                .DerivesFrom<ViewResult>()
                .IsConcreteClass()
                .IsUnsealed()
                .HasDefaultConstructor()
                .Implements<IViewResult>()
                .Result);
        }

        [Fact]
        public void ctor()
        {
            try
            {
                Default.Register<InternalServerError>("<resource />");

                InternalServerErrorViewResult obj = new InternalServerErrorViewResult();

                Assert.Equal<string>("Error", obj.ViewName);
                Assert.IsType<InternalServerError>(obj.ViewData.Model);
            }
            finally
            {
                Default.Reset();
            }
        }
    }
}